Skip to content

[Enhancement] Make filter section collapsible to improve popup layout#387

Open
gurusatsangi wants to merge 11 commits intofossasia:mainfrom
gurusatsangi:fix-collapsible-advanced-filters
Open

[Enhancement] Make filter section collapsible to improve popup layout#387
gurusatsangi wants to merge 11 commits intofossasia:mainfrom
gurusatsangi:fix-collapsible-advanced-filters

Conversation

@gurusatsangi
Copy link
Contributor

@gurusatsangi gurusatsangi commented Feb 20, 2026

📌 Fixes

Fixes #385


📝 Summary of Changes

  • Wrapped existing filter checkboxes inside a collapsible “Advanced Filters” section
  • Added a toggle button to expand/collapse the filter options
  • No changes made to filter logic or report generation
  • No API behavior modified
  • UI/UX enhancement only

📸 Screenshots / Demo

Before

All filter checkboxes were visible by default, increasing popup height and making the layout visually cluttered.
Screenshot 2026-02-18 191510

After

Filter options are collapsed under an “Advanced Filters” section by default and can be expanded when needed, resulting in a cleaner and more compact popup layout.
image


✅ Checklist

  • I have tested the changes locally
  • No console errors
  • No breaking changes introduced
  • Existing functionality remains unchanged
  • Dark mode tested
  • Scope limited strictly to UI enhancement

👀 Reviewer Notes

This PR introduces a collapsible wrapper for the filter section to improve layout clarity and reduce vertical clutter in the popup. All existing functionality remains intact.

Summary by Sourcery

Make the popup’s filter section collapsible under an “Advanced Filters” toggle to reduce vertical clutter while preserving existing behavior.

New Features:

  • Add an Advanced Filters toggle button that expands and collapses the filter section in the popup.

Enhancements:

  • Wrap existing popup filter controls in a collapsible Advanced Filters container for a more compact layout.

Summary by Sourcery

Make the popup’s filter section collapsible under an Advanced Filters toggle to reduce vertical clutter while preserving existing behavior.

New Features:

  • Add an Advanced Filters toggle that shows and hides the existing filter options in the popup.

Enhancements:

  • Wrap existing popup filter controls in a collapsible Advanced Filters container for a more compact layout.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 20, 2026

Reviewer's Guide

Wraps the existing popup filter controls in a new "Advanced Filters" collapsible section, wired up with a toggle button and icon rotation, without changing any underlying filter logic or API behavior.

Sequence diagram for Advanced Filters toggle behavior in the popup

sequenceDiagram
    actor User
    participant PopupUI
    participant PopupScript

    User->>PopupUI: Click toggleAdvancedFilters button
    PopupUI->>PopupScript: click event on toggleAdvancedFilters
    PopupScript->>PopupUI: Toggle hidden class on advancedFiltersContent
    PopupScript->>PopupUI: Toggle rotate-180 class on advancedFiltersArrow
    PopupUI->>User: Update layout and arrow orientation
Loading

File-Level Changes

Change Details Files
Introduce an "Advanced Filters" collapsible wrapper around the existing filter controls in the popup UI.
  • Add an Advanced Filters header label and toggle button above the existing filter checkboxes.
  • Wrap the existing filter controls in a container div that is hidden/shown via a CSS class toggle.
  • Insert a chevron icon that visually indicates the collapsed/expanded state.
src/popup.html
Wire up the Advanced Filters toggle behavior in JavaScript.
  • Query the Advanced Filters toggle button, content container, and chevron icon on DOMContentLoaded.
  • Attach a click handler that toggles the hidden class on the content container to show/hide filters.
  • Toggle a rotate-180 class on the chevron icon to reflect expanded/collapsed state.
src/scripts/popup.js
Minor formatting/EOF adjustment in CSS.
  • Ensure the popup mode width rule ends cleanly at the end of the file (no functional CSS change).
src/index.css

Assessment against linked issues

Issue Objective Addressed Explanation
#385 Wrap the existing filter checkboxes in the popup inside a collapsible "Advanced Filters" section so the popup is more compact by default.
#385 Implement the collapsible behavior using UI-only changes (no changes to filter logic or API behavior; existing functionality remains unchanged).

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions bot added javascript Pull requests that update javascript code frontend extension labels Feb 20, 2026
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider adding basic accessibility attributes to the toggle (e.g., aria-expanded on the button and aria-controls/aria-hidden on the content container) and keep them in sync when opening/closing the advanced filters section.
  • The toggle label text is duplicated between the HTML (Advanced Filters ▼) and the JavaScript ("Advanced Filters ▼" / "Advanced Filters ▲"); it would be more maintainable to derive the label from a single source or use CSS to render the arrow indicator.
  • The global .hidden { display: none; } utility might conflict with other styles; if this project already has a hide/show helper or scoped CSS, consider reusing or namespacing this class instead of adding a generic one.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding basic accessibility attributes to the toggle (e.g., `aria-expanded` on the button and `aria-controls`/`aria-hidden` on the content container) and keep them in sync when opening/closing the advanced filters section.
- The toggle label text is duplicated between the HTML (`Advanced Filters ▼`) and the JavaScript (`"Advanced Filters ▼"` / `"Advanced Filters ▲"`); it would be more maintainable to derive the label from a single source or use CSS to render the arrow indicator.
- The global `.hidden { display: none; }` utility might conflict with other styles; if this project already has a hide/show helper or scoped CSS, consider reusing or namespacing this class instead of adding a generic one.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@gurusatsangi
Copy link
Contributor Author

Hi @hpdang @vedansh-5

This PR is ready for review.

It introduces a collapsible Advanced Filters section to improve the popup layout and reduce vertical clutter.
No logic or API changes were made — only UI restructuring.

All existing functionality has been tested locally (report generation, dark mode, toggles, etc.).

Kindly review when convenient.
Thank you!

Copy link
Member

@vedansh-5 vedansh-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gurusatsangi for your contributions!

src/index.css Outdated
Comment on lines +888 to +908
.advanced-filters-btn {
width: 100%;
padding: 8px;
margin-top: 10px;
background-color: #f3f4f6;
border: 1px solid #d1d5db;
border-radius: 6px;
cursor: pointer;
font-weight: 500;
}

.advanced-filters-content {
margin-top: 8px;
padding: 8px;
border: 1px solid #e5e7eb;
border-radius: 6px;
}

.hidden {
display: none;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the same styling as existing labels and replace the dropdown triangle with an arrow
Like the one in platform selector dropdown
Image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok i will working on it and do it by tommorow

@gurusatsangi
Copy link
Contributor Author

gurusatsangi commented Feb 27, 2026

@vedansh-5 Updated the Advanced Filters styling to fully match the platform selector dropdown (same classes, spacing, and chevron arrow). Removed custom CSS and aligned with existing design. Please review again.
added updated image
image

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #385 by wrapping the existing filter checkboxes (show PRs labels, only issues, only PRs, only reviewed PRs, show commits) inside a collapsible "Advanced Filters" section with a toggle button and an animated arrow icon, reducing the vertical clutter in the extension popup.

Changes:

  • src/popup.html: Added a collapsible "Advanced Filters" container wrapping all filter checkboxes, with a toggle button and chevron arrow.
  • src/scripts/popup.js: Added a click event listener for the toggle button to show/hide filter content and rotate the arrow icon.
  • src/index.css: Added a .hidden CSS rule (display: none).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
src/popup.html Wraps all filter checkboxes in a collapsible advanced-filters-container div with a toggle button and chevron icon
src/scripts/popup.js Adds toggle click handler to show/hide filter content and rotate the chevron arrow
src/index.css Adds a .hidden { display: none } rule (already exists in tailwindcss.css)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +209 to +220
<button type="button"
id="toggleAdvancedFilters"
class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 pr-8 flex items-center justify-between focus:outline-none focus:ring-2 focus:ring-blue-500">

<span class="flex items-center">
Advanced Filters
</span>

<i id="advancedFiltersArrow"
class="fa fa-chevron-down text-gray-500 transition-transform duration-200">
</i>
</button>
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new toggle button lacks aria-expanded and aria-controls attributes. These are standard accessibility attributes for collapsible/disclosure widgets: aria-expanded should reflect the current open/closed state (toggled by the JS click handler alongside the class changes), and aria-controls should reference the ID of the controlled content (advancedFiltersContent). Without these, assistive technology users cannot determine the state of or relationship between the button and the collapsible content.

Copilot uses AI. Check for mistakes.
src/popup.html Outdated
Comment on lines +217 to +218
<i id="advancedFiltersArrow"
class="fa fa-chevron-down text-gray-500 transition-transform duration-200">
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The transition-transform and duration-200 utility classes used on the arrow icon (<i>) element are not defined in the local tailwindcss.css (which only bundles the subset of Tailwind utilities actually used in this project). Without these, the smooth CSS transition of the arrow rotation won't work. A transition: transform 0.2s ease-in-out; rule needs to be added for the arrow icon in src/index.css.

Copilot uses AI. Check for mistakes.
src/popup.html Outdated
Comment on lines +204 to +215
<p class="font-medium text-sm"style="margin-bottom: 0.3rem;">
Advanced Filters
</p>

<div class="relative mb-4" >
<button type="button"
id="toggleAdvancedFilters"
class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 pr-8 flex items-center justify-between focus:outline-none focus:ring-2 focus:ring-blue-500">

<span class="flex items-center">
Advanced Filters
</span>
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Advanced Filters" label text appears redundantly twice: once in a <p> element immediately above the button (line 204–206), and once inside the button's <span> (line 213–215). This creates a visually duplicated heading and button label. One of these should be removed — typically the standalone <p> label above the button is unnecessary since the button itself already carries the label text.

Copilot uses AI. Check for mistakes.
src/popup.html Outdated
Comment on lines +204 to +215
<p class="font-medium text-sm"style="margin-bottom: 0.3rem;">
Advanced Filters
</p>

<div class="relative mb-4" >
<button type="button"
id="toggleAdvancedFilters"
class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 pr-8 flex items-center justify-between focus:outline-none focus:ring-2 focus:ring-blue-500">

<span class="flex items-center">
Advanced Filters
</span>
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Advanced Filters" text strings in both the <p> label and the button <span> are hardcoded in English, while the rest of the popup's user-facing strings use the data-i18n attribute for internationalization (the project supports 18 locales). These strings should also be internationalized with a data-i18n attribute referencing a key defined in the locale files.

Copilot uses AI. Check for mistakes.
@vedansh-5 vedansh-5 self-requested a review March 2, 2026 22:00
Copy link
Member

@vedansh-5 vedansh-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gurusatsangi for your contribution. Please pull in the latest changes in master branch and also address the comments mentioned below and copilots' review comments.

src/popup.html Outdated
Comment on lines +201 to +208
<!-- Advanced Filters Wrapper -->
<div class="advanced-filters-container">

<p class="font-medium text-sm"style="margin-bottom: 0.3rem;">
Advanced Filters
</p>

<div class="relative mb-4" >
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the same spacing between sections.

Image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image_2026-03-03_130831577 @vedansh-5 Is the spacing correct tell me and i have removed advaced filters text appears redundantly twice. tell me show i can commit changes

src/popup.html Outdated
Comment on lines +209 to +214
<button type="button"
id="toggleAdvancedFilters"
class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 pr-8 flex items-center justify-between focus:outline-none focus:ring-2 focus:ring-blue-500">

<span class="flex items-center">
Advanced Filters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make this compatible for dark mode

Image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay i will fixed full give me some time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image @vedansh-5 check this also is it correct or not.

gurusatsangi and others added 4 commits March 3, 2026 11:44
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gurusatsangi gurusatsangi requested a review from vedansh-5 March 3, 2026 07:56
@gurusatsangi gurusatsangi marked this pull request as draft March 3, 2026 07:57
@gurusatsangi
Copy link
Contributor Author

sorry for last two commit i have done it by mistake show please ignore it.

@gurusatsangi gurusatsangi marked this pull request as ready for review March 3, 2026 08:47
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider enhancing accessibility of the Advanced Filters toggle by wiring up aria-expanded and aria-controls to reflect the open/closed state and marking the chevron icon as decorative (e.g., aria-hidden="true").
  • The static "Advanced Filters" label appears both as a <p> above and as the button text; you might simplify this by using a single semantic heading/label associated with the toggle to reduce redundancy and clarify structure for screen readers.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider enhancing accessibility of the Advanced Filters toggle by wiring up `aria-expanded` and `aria-controls` to reflect the open/closed state and marking the chevron icon as decorative (e.g., `aria-hidden="true"`).
- The static `"Advanced Filters"` label appears both as a `<p>` above and as the button text; you might simplify this by using a single semantic heading/label associated with the toggle to reduce redundancy and clarify structure for screen readers.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@gurusatsangi gurusatsangi force-pushed the fix-collapsible-advanced-filters branch 3 times, most recently from c0a0019 to b6c108c Compare March 3, 2026 10:47
@gurusatsangi
Copy link
Contributor Author

@vedansh-5 can you help me i have pushed but sourcery review find error many time please help me

@suhaib-ilahi
Copy link

suhaib-ilahi commented Mar 4, 2026

Hey, @gurusatsangi, seems the sourcery review failed since innerHTML is being used with user-controlled data. When you insert data using innerHTML, the browser interprets it as HTML, which can allow malicious scripts (XSS) to execute if the data contains <script> or event handlers.
So you need to find the replacement for those mentioned by the sourcery, you can use the textContent or the DOM methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension frontend javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Make filter section collapsible to improve popup layout**

4 participants